
using System;
using Qdb.CS.Internal;
using Qdb.Ext;

namespace Qdb.CS.Internal
{
	/// <summary>
	/// This class exists to work around a decaf conversion problem
	/// when the code was directly in ServerMessageDispatcherImp.
	/// </summary>
	/// <remarks>
	/// This class exists to work around a decaf conversion problem
	/// when the code was directly in ServerMessageDispatcherImp.
	/// </remarks>
	/// <exclude></exclude>
	internal class FatalServerShutdown
	{
		internal FatalServerShutdown(ObjectServerImpl server, Exception origExc)
		{
			try
			{
				server.Close(ShutdownMode.Fatal(origExc));
			}
			catch (Exception throwable)
			{
				throw new CompositeQdbException(new Exception[] { origExc, throwable });
			}
		}
	}
}
